
/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */
// require('./jQuery-2.1.4.min');
// require('./bootstrap');

// $(".toTop").click(function(){
//     $("html,body").animate({"scrollTop": "0px"},300);
//
// });

document.querySelector('.toTop').addEventListener('click', function () {
    (function smoothScroll(){
        var currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
        if (currentScroll > 0) {
            window.requestAnimationFrame(smoothScroll);
            window.scrollTo(0, currentScroll - (currentScroll/20));
        }
    })();
});

/*window.Vue = require('vue');

/!**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 *!/

Vue.component('example-component', require('./components/ExampleComponent.vue'));

const app = new Vue({
    el: '#app'/!*,
    ready: function() {
        this.$http.get('/sidebar/widget', function(data) {
            this.$set('widget', data.data);
            console.log(data);
        }).error(function(data, status, request) {
            console.log('fail' + status + ',' + request);
        })
    },
    data: {

    }*!/
});*/
